
using System;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;

[CreateAssetMenu(menuName = "动画组件")]
public class CompDotween : ScriptableObject
{
    public List<MyDoComp> Datas;
}

[Serializable]
public class MyDoComp
{
    public DoType Type;
    public Vector3 V3;
    public float Time;
    public bool 立刻;

    public Tween Tweener(Transform tran)
    {
        Tween t = null;
        switch (Type)
        {
            case DoType.LocalMove:
                if (立刻)
                {
                    tran.localPosition = V3;
                }
                else
                {
                    t = tran.DOLocalMove(V3, Time);
                }
                break;
            case DoType.LocalSize:
                if (立刻)
                {
                    tran.localScale = V3;
                }
                else
                {
                    t = tran.DOScale(V3, Time);
                }
                break;
        }

        return t;
    }
}

public enum DoType
{
    LocalMove,
    LocalSize,
}